package com.education.welco.mapper;

import com.education.welco.pojo.VirtualReality;
import com.education.welco.pojo.vo.VirtualRealityVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 虚拟仿真 持久层
 *
 * @Author: liftsail
 * @Date: 2023-04-13
 * @Description: 不积跬步无以至千里
 */
@Mapper
public interface VirtualRealityMapper {

    /**
     * 查询虚拟仿真信息
     *
     * @param id 虚拟仿真ID
     * @return 虚拟仿真信息
     */
    public VirtualReality selectVirtualRealityById(Integer id);

    /**
     * 查询虚拟仿真列表
     *
     * @param virtualReality 虚拟仿真信息
     * @return 虚拟仿真集合
     */
    public List<VirtualReality> selectVirtualRealityList(VirtualReality virtualReality);

    /**
     * 新增虚拟仿真
     *
     * @param virtualReality 虚拟仿真信息
     * @return 结果
     */
    public int insertVirtualReality(VirtualReality virtualReality);

    /**
     * 修改虚拟仿真
     *
     * @param virtualReality 虚拟仿真信息
     * @return 结果
     */
    public int updateVirtualReality(VirtualReality virtualReality);

    /**
     * 删除虚拟仿真
     *
     * @param id 虚拟仿真ID
     * @return 结果
     */
    public int deleteVirtualRealityById(Integer id);

    /**
     * 批量删除虚拟仿真
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteVirtualRealityByIds(String[] ids);

    /**
     * 查询资源被分享到几个学校
     *
     * @param id
     * @return
     */
    Integer selectVirtualRealitySchool(@Param("id") Integer id);

    /**
     * 学校分配资源列表查询附带回显
     *
     * @param schoolId
     * @return
     */
    List<VirtualReality> schoolVirtualRealityList(@Param("schoolId") Integer schoolId);

    /**
     * 依据学校id删除虚拟仿真中间表
     *
     * @param schoolId
     * @return
     */
    Integer deleteVirtualRealitySchoolBySchoolId(@Param("schoolId") Integer schoolId);

    /**
     * 虚拟仿真中间表批量插入关联关系
     *
     * @param vrIdList
     * @param schoolId
     * @return
     */
    Integer insertSchoolShareVR(@Param("vrIdList") List<Integer> vrIdList, @Param("schoolId") Integer schoolId);

    /**
     * 学校老师查询学校目前有权限的虚拟仿真资源
     *
     * @param schoolId
     * @return
     */
    List<VirtualReality> selectSchoolShareVRList(@Param("schoolId") Integer schoolId);

    /**
     * 教师端查看为课程分配的全部虚拟资源(资源状态有效|无效)
     *
     * @param schoolId
     * @param catalogId 课程二级目录id
     * @return
     */
    List<VirtualRealityVO> selectCatalogShareVRList(@Param("schoolId") Integer schoolId, @Param("catalogId") Integer catalogId);

    /**
     * 依据课程id删除虚拟仿真中间表
     *
     * @param catalogId 课程二级目录id
     * @return
     */
    Integer deleteVirtualRealityCatalogByCatalogId(@Param("catalogId") Integer catalogId);

    /**
     * 虚拟仿真中间表批量插入关联关系
     *
     * @param vrIdList
     * @param teaUserId
     * @param catalogId
     * @return
     */
    Integer insertCatalogShareVR(@Param("vrIdList") List<Integer> vrIdList, @Param("teaUserId") Integer teaUserId, @Param("catalogId") Integer catalogId);

    /**
     * 根据课程二级目录id得到该课程所在的学校id
     *
     * @param lessonId
     * @return
     */
    Integer selectSchoolIdBycatalogId(@Param("catalogId") Integer lessonId);
}